#!C:\Python\Python36\Python.exe
# -*- coding:utf-8 -*-
# @Time  : 2019-12-19 16:05
# @Author: iceman
# @File  : login.py

import cgi
from exesql import GetSql

def login():
    form = cgi.FieldStorage()
    site_name = form.getvalue("name1")
    site_pwd = form.getvalue("pwd1")
    sql = "insert into users (name,pwd) values ('%s','%s')" % (site_name, site_pwd)
    gs = GetSql(sql)
    gs.getlogin()
    flag_login = gs.flag
    print()
    print("""\
    Content-Type: text/html\n\n
    <html>
    <head>
    <meta charset="utf-8x">
    <title>test</title>
    </head>
    <body>
       <p>Account：%s</p>
       <p>job: %s<p>
       <p>flag_login: %s<p>
    </body>
    </html>
    """ % (site_name,site_pwd,flag_login))
    return flag_login